const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);
const appName = require("./package.json").name;
console.log("appName", appName);
module.exports = {
    devServer: {
        port: 9428,
        headers: {
            "Access-Control-Allow-Origin": "*", // 主应用获取子应用时跨域响应头
        },
    },
    configureWebpack: {
        output: {
            library: `${appName}-[name]`, //微应用的包名，与主应用中注册的微应用名称必须一致
            libraryTarget: "umd", // 把微应用打包成 umd 库格式
            jsonpFunction: `webpackJsonp_${appName}`, //按需加载相关，设置为 webpackJsonp_VueMicroApp 即可
        },
    },
    chainWebpack: (config) => {
        config.resolve.alias.set("@", resolve("src"));
    },
};
